<html>
<head>
<script language="javascript">
function validasi(form){
  if (form.username.value == ""){
    alert("Anda belum mengisikan Username.");
    form.username.focus();
    return (false);
  }
     
  if (form.password.value == ""){
    alert("Anda belum mengisikan Password.");
    form.password.focus();
    return (false);
  }
  return (true);
}
</script>

<style type="text/css" title="currentStyle">
		@import "<?php echo base_url();?>css/login.css";
</style>

	<meta name="description" content=""/>
	<meta name="keywords" content="" />
	<style type="text/css" title="currentStyle">
		@import "<?php echo base_url();?>css/gf-theme/jquery.ui.all.css";
		@import "<?php echo base_url();?>css/demos.css";
	</style>
	<script type="text/javascript" src="<?php echo base_url();?>js/jquery.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>js/jquery.ui.widget.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>js/jquery.ui.button.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>js/jquery.validate.min.js"></script>

	<script type="text/javascript" charset="utf-8">
		$(function() {
			$('#button-login').button({
				icons: {
					primary: 'ui-icon-person'
				}
			});

			$('#login_form').validate({
				errorLabelContainer: "#error",
				wrapper: "li",
				rules:
				{
					username: "required",
					password: "required"
				}
			});
		});
	</script>
	<title>Halaman Login</title>
</head>
<body OnLoad="document.login.username.focus();">
<br>
<table border="0" width="407" height="270" align="center" cellpadding="0" cellspacing="0" id="backlogin">
<tr><td style="padding-top:100px; padding-left:20px;">
<!--
<form name="login" action="cek_login.php" method="POST" onSubmit="return validasi(this)">
<table align="center">
<tr><td>Username</td><td> : <input type="text" name="username"></td></tr>
<tr><td>Password</td><td> : <input type="password" name="password"></td></tr>
<tr><td colspan="2"><input type="submit" value="Login"></td></tr>
</table>
</form>
-->

<?php
							echo "<center>";
							echo form_open('login/login_exec', 'id="login_form"');

							echo "<div id='error' class='error-message' ";

							if($this->session->userdata('ERRMSG_ARR'))
							{
								echo ">";
								echo $this->session->userdata('ERRMSG_ARR');
								$this->session->unset_userdata('ERRMSG_ARR');
							}
							else
							{
								echo "style='display:none'>";
							}

							echo "</div>";

								echo form_label('Username','username');
								echo '&nbsp;&nbsp;&nbsp;&nbsp;';
								$data['name'] = $data['id'] = 'username';
								$data['class'] = 'text';
								$data['title'] = "Username harus diisi";
								echo form_input($data);


								echo '<p>';
								echo form_label('Password','password');
								echo '&nbsp;&nbsp;&nbsp;&nbsp;';

								$data['name'] = $data['id'] = 'password';
								$data['title'] = "Password harus diisi";
								echo form_password($data);

								echo '<br>';

								$submit['name'] = 'submit';
								$submit['id'] = 'button-login';
								$submit['type'] = 'submit';
								$submit['content'] = 'Login';
								echo form_button($submit);

							echo form_close();
							echo "</center>";
						?>

</td>
</tr>
</table>
<center>Copyright &copy;2012 | Sistem Informasi Koperasi</center>
</body>
</html>
